package gdonly.top.signin.business;

import android.util.Log;

import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import gdonly.top.signin.entity.User;

/**
 * Created by zhuzhuxia on 2017/4/27.
 */
public class Application extends android.app.Application {
    private User thisUser = null;
    private List<User> truntUsers = null;
    private ExecutorService executor;
    @Override
    public void onCreate() {
        super.onCreate();
        executor = Executors.newCachedThreadPool();
    }
    public void setThisUser(User user){
        thisUser = user;
    }
    public User getThisUser(){
        return thisUser;
    }

    public List<User> getTruntUsers() {
        return truntUsers;
    }

    public void setTruntUsers(List<User> truntUsers) {

        this.truntUsers = truntUsers;
    }
    public void addThread(Runnable task){
        executor.execute(task);
        Log.e("TAG", "add a task....");
    }

    public Future<Object> submitTask(Callable task){
        Log.e("TAG", "submit a task....");
        return executor.submit(task);

    }
}
